﻿Partial Class Interfaz_Seleccion
    Inherits System.Web.UI.Page
    Dim CL As New logica.ModuloPrincipal.ControladorLogica

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        LabelUser.Text = Session("user").ToString
        FuncionAviso()
    End Sub


#Region "Botones"
    Protected Sub BtnLogout_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles BtnLogout.Click
        Session("user") = ""
        Response.Redirect("Principal.aspx")
    End Sub
#End Region


#Region "Funcionalidades"

    Public Sub Mensaje(ByVal msg As String)
        Dim alertScript As String = "<script language=JavaScript runat=server>"
        alertScript &= "alert('" & msg & "');"
        alertScript &= "</script>"
        ClientScript.RegisterClientScriptBlock(Page.GetType(), "clientScrip", alertScript)
    End Sub

    Private Sub FuncionAviso()
        Dim query As String = "select count(*) cuenta from solicitudes where estado ='P'"
        Dim cantidadPendientes As Integer = CInt(CL.Ejecuta(query).Item("cuenta").ToString)

        If cantidadPendientes <> 0 Then
            Image2.Visible = True
            Image3.Visible = False
        Else
            Image2.Visible = False
            Image3.Visible = True
        End If
    End Sub

#End Region



End Class
